package net.lqy.aipan.config;

/**
 * @title: Knife4jConfig
 * @Author lqy
 * @Date: 2025-06-01 20:03
 * @Version 1.0
 */

import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Knife4j配置 ，默认是下面
 *
 * knife4j 访问地址: http://localhost:8080/doc.html
 * Swagger2.0访问地址: http://localhost:8080/swagger-ui.html
 * Swagger3.0访问地址: http://localhost:8080/swagger-ui/index.html
 */
@Slf4j
@Configuration
public class Knife4jConfig {
    @Bean
    public OpenAPI customOpenAPI() {
        return new OpenAPI()
                .info(new Info()
                        .title("AI网盘系统 API")
                        .version("1.0")
                        .description("AI网盘系统")
                        .termsOfService("https://www.njupt.edu.cn/")
                        .license(new License().name("Apache 2.0").url("https://www.njupt.edu.cn/"))
                        // 添加作者信息
                        .contact(new Contact()
                                .name("lqy") // 替换为作者的名字
                                .email("1739864725@qq.com") // 替换为作者的电子邮件
                                .url("https://www.njupt.edu.cn/") // 替换为作者的网站或个人资料链接
                        )
                );
    }
}